﻿namespace Dcms.Model
{
    using System;

    public class Dcms_FileFolderModel
    {
        private string _fileext;
        private string _fileformatname;
        private string _filefullname;
        private DateTime _filemodifydate;
        private string _filename;
        private string _fileoperatestr;
        private long _filesize;
        private string _filetype;

        public Dcms_FileFolderModel(string p_name, string p_fullName, string p_formatName, string p_ext, long p_size, string p_type, DateTime p_modifyDate, string p_operate)
        {
            this._filename = p_name;
            this._fileformatname = p_formatName;
            this._filefullname = p_fullName;
            this._fileext = p_ext;
            this._filesize = p_size;
            this._filetype = p_type;
            this._filemodifydate = p_modifyDate;
            this._fileoperatestr = p_operate;
        }

        public string FileExt
        {
            get
            {
                return this._fileext;
            }
        }

        public string FileFormatName
        {
            get
            {
                return this._fileformatname;
            }
        }

        public string FileFullName
        {
            get
            {
                return this._filefullname;
            }
        }

        public string FileModifyDate
        {
            get
            {
                return this._filemodifydate.ToString();
            }
        }

        public string FileName
        {
            get
            {
                return this._filename;
            }
        }

        public string FileOperateStr
        {
            get
            {
                return this._fileoperatestr;
            }
        }

        public string FileSize
        {
            get
            {
                if (this._filesize == 0) return string.Empty;
                if (this._filesize.ToString().Length < 8) return ((this._filesize / 0x400) + " KB");
                return ((this._filesize / 0x400 / 0x400) + " MB");
            }
        }

        public string FileType
        {
            get
            {
                return this._filetype;
            }
        }
    }
}

